﻿using System.Linq;
using System.Text;
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace TheGame
{
    public class SligFactory
    {
        #region VARS
        public Texture2D Pass1_R;
        public Texture2D Pass1_L;
        public Texture2D Pass2_R;
        public Texture2D Pass2_L;
        public Texture2D Pass3_R;
        public Texture2D Pass3_L;
        public Texture2D PassStop_R;
        public Texture2D PassStop_L;
        public Texture2D OnePass_R;
        public Texture2D OnePass_L;
        public Texture2D Run1_R;
        public Texture2D Run1_L;
        public Texture2D Run2_R;
        public Texture2D Run2_L;
        public Texture2D Run3_R;
        public Texture2D Run3_L;
        public Texture2D Run4_R;
        public Texture2D Run4_L;
        public Texture2D RunStart_R;
        public Texture2D RunStart_L;
        public Texture2D RunStop1_R;
        public Texture2D RunStop1_L;
        public Texture2D RunStop2_R;
        public Texture2D RunStop2_L;
        public Texture2D Shoot_R;
        public Texture2D Shoot_L;
        public Texture2D ShootStart_R;
        public Texture2D ShootStart_L;
        public Texture2D ShootStop_R;
        public Texture2D ShootStop_L;
        public Texture2D Start_R;
        public Texture2D Start_L;
        public Texture2D Turn_R;
        public Texture2D Turn_L;
        public Texture2D Wait_R;
        public Texture2D Wait_L;
        public Texture2D Sleep_R;
        public Texture2D Sleep_L;
        public Texture2D Wake_R;
        public Texture2D Wake_L;
        public Texture2D DownPlane_R;
        public Texture2D DownPlane_L;
        public Texture2D Splat_R;
        public Texture2D Splat_L;
        public Texture2D Possessed_R;
        public Texture2D Possessed_L;
        public Texture2D Ouch_R;
        public Texture2D Ouch_L;

        public Animation START;
        public Animation PASS1;
        public Animation PASS2;
        public Animation PASS3;
        public Animation PASSsTOP;
        public Animation ONEPASS;
        public Animation RUN1;
        public Animation RUN2;
        public Animation RUNsTART;
        public Animation RUNsTOP;
        public Animation SHOOT;
        public Animation SHOOTsTART;
        public Animation SHOOTsTOP;
        public Animation TURN;
        public Animation WAIT;
        public Animation WAKE;
        public Animation SLEEP;
        public Animation WHAAT;
        public Animation FREEZE;
        public Animation POSSESSED;

        public SoundEffect Sound_PASS;
        public SoundEffect Sound_TURN;
        public SoundEffect Sound_WHAAT;
        public SoundEffect Sound_FREEZE;
        public SoundEffect Sound_SPLAT;
        public SoundEffect Sound_HELP;
        public SoundEffect Sound_SHOOT;
        public SoundEffect Sound_POSSESSED;

        public Texture2D sLIG_BBOX_PNG;
        public Rectangle SligEye;
        public Rectangle SligEar;

        public SligAI AI;
        public Game1 game; 
        #endregion

        //Questa classe serve per caricare solo una volta le risorse (sprites, audio)
        //I riferiemnti alle risorse vengono acceduti da ogni istanza delle classi Slig e SligAI
        public SligFactory(Game1 game)
        {
            this.game = game;

            Pass1_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\PASS1_R_220");
            Pass1_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\PASS1_L_220");
            Pass2_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\PASS2_R_220");
            Pass2_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\PASS2_L_220");
            Pass3_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\PASS3_R_220");
            Pass3_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\PASS3_L_220");
            PassStop_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\PASSsTOP_R_220");
            PassStop_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\PASSsTOP_L_220");
            OnePass_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\ONEPASS_R_220");
            OnePass_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\ONEPASS_L_220");
            Run1_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\RUN1_R_300");
            Run1_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\RUN1_L_300");
            Run2_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\RUN2_R_300");
            Run2_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\RUN2_L_300");
            Run3_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\RUN3_R_300");
            Run3_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\RUN3_L_300");
            Run4_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\RUN4_R_300");
            Run4_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\RUN4_L_300");
            RunStart_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\RUNsTART_R_300");
            RunStart_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\RUNsTART_L_300");
            RunStop1_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\RUNsTOP1_R_300");
            RunStop1_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\RUNsTOP1_L_300");
            RunStop2_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\RUNsTOP2_R_300");
            RunStop2_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\RUNsTOP2_L_300");
            Shoot_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\SHOOT_R_220");
            Shoot_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\SHOOT_L_220");
            ShootStart_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\SHOOTsTART_R_220");
            ShootStart_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\SHOOTsTART_L_220");
            ShootStop_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\SHOOTsTOP_R_220");
            ShootStop_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\SHOOTsTOP_L_220");
            Start_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\START_R_220");
            Start_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\START_L_220");
            Turn_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\TURN_R_100");
            Turn_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\TURN_L_100");
            Wait_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\WAIT_R_220");
            Wait_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\WAIT_L_220");
            
            Wake_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\WAKE_R_220");
            Wake_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\WAKE_L_220");
            Sleep_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\SLEEP_R_220");
            Sleep_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\SLEEP_L_220");

            DownPlane_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\DOWNPLANE_R_150");
            DownPlane_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\DOWNPLANE_L_150");
            Splat_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\SPLAT_R_130");
            Splat_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\SPLAT_L_130");
            Possessed_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\POSSESSED_R_130");
            Possessed_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\POSSESSED_L_130");
            Ouch_R = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\OUCH_R_180");
            Ouch_L = game.Content.Load<Texture2D>("Sprite_Sheet\\Slig\\OUCH_L_180");


            Sound_PASS = game.Content.Load<SoundEffect>("Sound\\SLIG_PASS");
            Sound_TURN = game.Content.Load<SoundEffect>("Sound\\SLIG_TURN");
            Sound_WHAAT = game.Content.Load<SoundEffect>("Sound\\SLIG_WHAAT");
            Sound_FREEZE = game.Content.Load<SoundEffect>("Sound\\SLIG_FREEZE");
            Sound_SPLAT = game.Content.Load<SoundEffect>("Sound\\SPLAT");
            Sound_HELP = game.Content.Load<SoundEffect>("Sound\\HEEELP");
            Sound_SHOOT = game.Content.Load<SoundEffect>("Sound\\SHOOT2");
            Sound_POSSESSED = game.Content.Load<SoundEffect>("Sound\\JUSTPOSSESSED");

            sLIG_BBOX_PNG = game.Content.Load<Texture2D>("Sprite_Sheet\\Abe\\ABE_BBOX");
        }
    }
}
